<script type="text/javascript">
$(function(){
	$(".home .label").live('click',function(){
		$(this).prev().focus();
	});
	$(".home input,.home textarea").live('keyup',function(){
                
		if($(this).val()=='')
			$(this).next().show();
		else
			$(this).next().hide();
	});
	$(".ybwangzhi input").live('change',function(){

		if($('.ybwangzhi input[value!=]').length>$('.ybwangzhi input').length-2){
			$(".ybwangzhi ul").append('<li><span>商品'+ ($('.ybwangzhi input').length+1) + '：</span><input name="url[]"  class="danhao" type="text" value="" /><label class="label product">请填写商品详细网址</label></li>');
		}
	})
});

</script>
<style>
.home .label{color:#bbb;float:left;margin-top:-25px;width:250px;display:block;cursor:text;margin-left:8px;position: relative;z-index:9}
.home .label.product{margin-left:63px;}
</style>
<div class="center">
	<div class="home">  
        <div class="home_left">
            <?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user,'account'=>$this->account)); ?>
        </div>
    	
    	<div class="home_right">
            <div class="storehousetop">
                <div class="storehouse">
                    <div class="cloudyb">
                        <span>预报入库</span>
                    </div>
                    <div class="storehouseinfo">
                        <h1>预报入库</h1>
                        <div class="storehousenum">
                        	<h3>交易提醒：</h3>
                            <ul>
                                <li><a href="/member/mystore">我的库存</a></li>                                
                                <li><a href="/member/waybill">我的国际运单</a></li>
                            </ul>
                            <p><a href="http://help.uuch.com/?p=62" target="_blank"><i></i>如何使用云仓库？</a></p>
                        </div>
                    </div>
                </div>
                <div class="storehousenav">
                    <ul>                        
                        <li><a href="/member/forecastlist"><i class="storehouse5"></i>预报列表<?php if($this->uCount["ingstore"]==0) echo ''; else echo '<span>'.$this->uCount["ingstore"].'</span>';?></a></li>
                        <li class="storehouseon"><a href="/member/instore"><i class="storehouse4"></i>预报入库</a></li>
                    </ul>
                </div>
            </div> 
            <form method="POST" name="instore" onSubmit="return checkIt(id,1)"  action="/member/instore/">
            <div class="yubao">
                
                <div class="yubaotop">
                    <table>
                        <tr>
                            <td class="fz"><i>*</i>来源：</td>
                            <td>
                                <div class="kuaidi">
                                    	<div class="input"><?= $this->formText('expressname',$this->expressname,array('readonly'=>'readonly')) ?><i></i>
                                        <?= $this->formHidden('expressid',$this->expressid)?>
                                        </div>
                                        <div class="kdtc" style="display:none;">
                                            <div class="kdremen">
                                                <h4>热门快递公司</h4>
                                                <ul class="kdlist">
                                                    <li><a href="#" cid="3">EMS</a></li>
                                                    <li><a href="#" cid="21">顺丰</a></li>
                                                    <li><a href="#" cid="9">申通</a></li>
                                                    <li><a href="#" cid="8">中通</a></li>
                                                    <li><a href="#" cid="11">圆通</a></li>
                                                    <li><a href="#" cid="18">宅急送</a></li>
                                                    <li><a href="#" cid="13">韵达</a></li>
                                                </ul>
                                            </div>
                                            <div class="allkd">
                                                <h4>全部快递</h4>
                                                <ul class="kdzm">
                                                    <?
                                foreach ($this->words as $char){
                                ?>
                                <li <?= $char=='A'?'class="zmon"':'' ?>><a href="#"><?= $char ?></a></li>
                                <? }
                                ?>
                                                </ul>
                                                <div id="kdTab">
                                                    <?foreach ($this->words as $char){ ?>
                           <ul class="kdlist"  <?= $char=='A'?'':'style="display:none"' ?>>
                               <?
                               $ships= Application_Model_shipType::getByWord($char);
                               foreach ($ships as $ship){
                               ?>
                            	<li><a href="#" cid="<?= $ship->Id ?>"><?= $ship->Name ?></a></li>
                                <? } ?>
                            </ul>
                            <? } ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="fz"><i>*</i>快递单号：</td>
                            <td><?= $this->formText('logistics',$this->expressno,array('class'=>'danhao')) ?>
                            <label class="label" <?= $this->expressno?'':'style="display:none"' ?>>请输入快递单号！</label>
                            </td>
                        </tr>
                        <tr>
                            <td class="fz"><i>*</i>包裹名称：</td>
                            <td>
                            	<?= $this->formText('name',$this->name,array('class'=>'danhao')) ?>
                            </td>
                        </tr>
                        <tr>
                            <td class="fz">货物备注：</td>
                            <td><textarea style="float:left;width:400px;height:80px;" name="remark" class=""></textarea>
                            
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><p>注：预报时在备注填写物品清单，将有助于悠奇快速帮您入库，同时清点物品，完成验货等功能。</p></td>
                        </tr>
                    </table>
                    
                </div>
                <? /*
                <div class="yubaobottom">
                    <table>
                        <tr>
                            <td class="fz"></td>
                            <td>
                                <label><?= $this->formCheckbox('hasDetail')?> 我想要悠奇清点物品，我需要填写物品清单</label>
                            </td>
                        </tr>
                    </table>
                    <div class="ybwangzhi" id="product" style="display:none" name="product" >
                    	<ul>
                            <li><span>商品1：</span><input name="url[]"  class="danhao" type="text" value="" /><label class="label product">请填写商品网址或物品名称、数量</label></li>
                            <li><span>商品2：</span><input name="url[]"  class="danhao" type="text" value="" /><label class="label product">请填写商品网址或物品名称、数量</label></li>
                            <li><span>商品3：</span><input name="url[]"  class="danhao" type="text" value="" /><label class="label product">请填写商品网址或物品名称、数量</label></li>
                        </ul>
                        <p>注：如果您是在淘宝、京东等购物网站购买的商品，您可以填写商品网址，悠奇将帮您核对商品是否属实，如果是一般包裹，您只需要填写商品名称和数量即可。如：红衣小背心3件</p>
                    </div>
                </div>
                 * 
                 */ ?>
                <div class="forecastok">
                    <input type="submit" value="确定提交预报" onmouseover="this.className='fon'" onmouseout="this.className=''" />
                    <? if($this->addFlag){ ?>
                    <div class="tanceng" id="addForm" style="">
                        
                        <div class="tancengtop">
                            <h2><i></i>恭喜您！您的预报添加成功！</h2>
                        </div>
                        <div class="tancengb">
                            <a href="/member/instore/"><span>继续预报</span></a><a href="/member/forecastlist"><span>查看我的预报</span></a>
                        </div>
                    </div>
                    <? } ?>
                </div>
            </div>
</form>
            <div class="forecastask">
                <div class="asklm">
                    <h2>使用遇到问题？</h2>
                </div>
                <div class="asklist">
                    <ul>
                        <li>
                            <h3>我为什么要提交到货预报？</h3>
                            <p>答：您提交的到货预报信息，可以有助于仓库收到您的包裹后，第一时间快速准确的入库到您专属的仓位上；同时预报列表可以让您管理不同网站采购的商品。</p>
                        </li>
                        <li>
                            <h3>提交到货预报和提交在途包裹订单有什么不同？</h3>
                            <p>答：您提交在途包裹订单，相当于您对一票一件货物同时下达"到货预报+提交订单"的指令；当仓库收到您的包裹后，第一时间快速发货。</p>
                        </li>
                    </ul>
                </div>
            </div>
        
        </div>
	

</div>
</div>
<script type="text/javascript">
$(function(){
    
    $('.kuaidi').hover(function(){
        $('.kdtc').show();
    }, function(){
        $('.kdtc').hide();
    });
    
    $('.kdzm a').each(function(index,item){
        $(item).click(function(){
            $('.kdzm li.zmon').removeClass('zmon');
            $(this).parent().addClass('zmon');
            $('#kdTab ul').hide();
            $('#kdTab ul').eq(index).show();
            return false;
        });
    });
    $('.kdlist a').click(function(){
        $('#expressname').val($(this).text());
        $('#expressid').val($(this).attr('cid'));
        $('.kdtc').hide();
        return false;
    });
    $('#express_submit').click(function(){
        $(this).attr('href','/member/instore?expressid='+ $('#expressid').val()+'&expressno='+$('#expressno').val());
    });
    $('#hasDetail').change(function(){
        if($(this).is(':checked')){
            $('#product').show();
        }else{
            $('#product').hide();
        }
    });
});    
</script>

